set(AUDIOSOURCEFILES ${LIBRARY_BUILD_TYPE}  audio.h audio.cpp audio_warp.c)

find_package(lua REQUIRED)

add_library(AUDIO ${AUDIOSOURCEFILES})

target_include_directories(AUDIO
  PUBLIC ${CMAKE_SOURCE_DIR}/3rd/irrklang/include
  INTERFACE ${LUA_INCLUDE_DIR})

target_link_libraries(AUDIO
  PUBLIC ${CMAKE_SOURCE_DIR}/3rd/irrklang/irrKlang.lib
  PUBLIC ${LUA_LIBRARIES})

set_target_properties(AUDIO PROPERTIES
  OUTPUT_NAME "audio"
  RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/dist/clib"
  CXX_STANDARD 20)

add_custom_command(TARGET AUDIO POST_BUILD
  COMMAND ${CMAKE_COMMAND} -E remove
  ${CMAKE_SOURCE_DIR}/dist/clib/lua.dll)


